<style scoped>
</style>

<template>
<div>
   user:{{_user.name}} {{_user.state}}
   <button @click="logout">logout</button>
</div>
</template>
<script>
export default {
    data(){
        return {

        }
    },asyncData({store,route}){
        console.log('user asyncData')
      return store.dispatch('add_number')
      
    },computed:{
        _user(){
            return this.$store.getters.getuser;
        }
    },methods:{
        logout(){
            this.$store.dispatch('destroy_user').then(()=>{
                this.$router.push('/login');
            })
            
        }
    }
}
</script>